
<thead>
<tr class="active w_table_tr1">
    <td style="width: 12%">创建时间</td>
    <td style="width: 13%">竞价单号</td>
    <td style="width: 15%">竞价单名称</td>
    <td style="width: 12%">竞价单类型</td>
    <td style="width: 15%">已报价数</td>
    <td style="width: 15%">竞拍成功数(金额)</td>
    <td style="width: 8%">操作</td>
</tr>
</thead>
<tbody>
<notempty name="list">
    <volist name="list" id="vo">
        <php>
            $cate_type=M('bid_type')->where(array('id'=> $vo['cate_id']))->getField('name');
            echo $vo['cate_id'];
            switch ($vo['cate_id']) {
            case '1':
              $user_list=M('bid_user')->where(array('bid_id'=>$vo['id']))->order('user_price desc')->select();
              $bid_count=count($user_list);
              $bid_success=1;
              $bid_price=$user_list[0]['user_price'];
              break;

            case '2':
             $user_list=M('bid_user')->where(array('bid_id'=>$vo['id']))->select();
             $bid_count=count($user_list);

              $my_bids=M('bid_user')->where(array('bid_id'=>$vo['id'],'user_id'=>is_login()))->select();
              $my_bids=get_id_key($my_bids,'good_id');
              $bid_success=0;
              $bid_price=0;
              foreach ($my_bids as $k=>&$v){
                 $map['bid_id']=$vo['id'];
                 $map['user_price']=array('gt',$v['user_price']);
                 $map['good_id']=$v['good_id'];
                 //获取单个商品报价高于我的人数
                 $item_count=M('bid_user')->where($map)->count();
                 if($item_count==0){
                        $bid_success+=$v['user_number'];
                        $bid_price+=$v['user_price'];
                   }
               }

              break;
            }

        </php>

        <tr class="odd gradeX">
            <td>{$vo.start_time|time_format='Y-m-d H:i:s'}</td>
            <td>{$vo.bid_sn}</td>
            <td>{$vo.name}</td>
            <td class="center">{$cate_type}</td>
            <td class="center">{$bid_count}</td>
            <td>{$bid_success}({$bid_price})</td>
            <td style="width: 8%" class="w_table_a1">
                <a href="{:U('bidding_end',array('id'=>$vo['id']))}" target="_blank">详情</a></a>
            </td>
        </tr>
    </volist>
    <else/>
    <tr><td colspan="7" class="text-center"> aOh!  暂时还没有信息! </td>
    </tr>
</notempty>
</tbody>